using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ArmorManager {
	
	static string typeName = typeof(ProtectiveItem).ToString();
	
	static GenericManager<ProtectiveItem> _m;
	
	public static Dictionary<string,string> index
	{
		get
		{
			if(_m == null)
				_m = new GenericManager<ProtectiveItem>(typeName);
			return _m.index;
		}
	}
	
	public static ProtectiveItem AddArmor(string name, string description, float weight, int bonus, 
		string type = "Armor", string slot = "Armor", int maxDex = 999, int checkPenalty = 0, int spellFailure = 0,
		List<BuffDebuff> buffs = null, float worth = 0, bool hasCharges = false, int chargesRemaining = 50)
	{
		ProtectiveItem a = new ProtectiveItem();
		
		BuffDebuff armorBonus = new BuffDebuff();
		armorBonus.name = name;
		armorBonus.description = "The AC bonus provided by equipping " + name;
		armorBonus.modifiers.Add(new TemporaryBonus());
		armorBonus.modifiers[0].amount = bonus;
		armorBonus.modifiers[0].type = type;
		armorBonus.modifiers[0].toStat = "AC";
		a.buffs.Add(armorBonus);
		
		a.maxDex = maxDex;
		a.checkPenalty = checkPenalty;
		a.name = name;
		a.description = description;
		a.weight = weight;
		a.spellFailure = spellFailure;
		a.slot = slot;
		
		a.buffs = buffs;
		a.worth = worth;
		a.quantity = 1;
		a.HasCharges = hasCharges;
		a.chargesRemaining = chargesRemaining;
		
		return _m.AddObject(a);
	}
}
